import { Behaviour, HitTestScript, TextRenderer } from "./gameengine";
import { user } from "./user";


export class hphupBehaviour extends Behaviour {


    // private speedX = 0;
    // private speedY = 0;


    protected onStart() {
      

    }
    protected onUpdate(advancedTime: number) {

        const textRender2 = this.displayObject.children[1].getScript(TextRenderer);
        textRender2.text = "40金提升10生命值";

        textRender2.displayObject.getScript(HitTestScript).onClick = () => {
            console.log("2");
            user.gold -= 40;    
            user.hp += 10;
       
        }
        
    }
}

